We might come across a scenario where we need to deploy resources in multiple AWS regions as a disastor recovery or backup plan.
Using Terraform for infrastructure as code we can achieve this using alias in Provider.
Primary region
Declare the provider with primary region as usual.
Backup region
Declare the second provider with alias which can be used while creating resources.
Now we can proceed using the alias to create resources in primary and backup regions in our case its us-east-1 and ap-southeast-1
Apply the terraform script to have EC2 machines created in two regions.
source
Share on: